package com.hackerrank.contests.aug13.challenges.battleship1player;

import java.util.Scanner;

public class Solution {
	private static final int C = 10;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		char b[][] = new char[N][C];
		in.nextLine();
		for(int n = 0; n < N; n++)
			b[n] = in.nextLine().toCharArray();
		// find h
		for(int r = 0; r < N; r++) {
			for(int c = 0; c < C; c++) {
				if(b[r][c] == 'h') {
					int rhc = c;
					while(rhc < C && b[r][rhc] == 'h')
						rhc++;
					if(rhc > c + 1) {
						// horizontal h case
						int h1 = 0, h2 = 0;
						while(c > h1 && b[r][c - h1 - 1] == '-')
							h1++;
						while(rhc + h2 < C && b[r][rhc + h2] == '-')
							h2++;
						if(h1 >= h2)
							System.out.println(r + " " + (c - 1));
						else
							System.out.println(r + " " + rhc);
					} else {
						int bhr = r;
						while(bhr < N && b[bhr][c] == 'h')
							bhr++;
						if(bhr > r + 1) {
							// vertical h case
							int v1 = 0, v2 = 0;
							while(r > v1 && b[r - v1 - 1][c] == '-')
								v1++;
							while(bhr + v2 < N && b[bhr + v2][c] == '-')
								v2++;
							if(v1 >= v2)
								System.out.println((r - 1) + " " + c);
							else
								System.out.println(bhr + " " + c);
						} else {
							// single h case
							int h1 = 0, h2 = 0, v1 = 0, v2 = 0;
							while(c > h1 && b[r][c - h1 - 1] == '-')
								h1++;
							while(rhc + h2 < C && b[r][rhc + h2] == '-')
								h2++;
							while(r > v1 && b[r - v1 - 1][c] == '-')
								v1++;
							while(bhr + v2 < N && b[bhr + v2][c] == '-')
								v2++;
							if(h1 >= h2 && h1 >= v1 && h1 >= v2)
								System.out.println(r + " " + (c - 1));
							else if(h2 >= h1 && h2 >= v1 && h2 >= v2)
								System.out.println(r + " " + rhc);
							else if(v1 >= h1 && v1 >= h2 && v1 >= v2)
								System.out.println((r - 1) + " " + c);
							else
								System.out.println(bhr + " " + c);
						}
					}
					return;
				}
			}
		}
		// no h case follows
		int[][] v1 = new int[N][C], v2 = new int[N][C], h1 = new int[N][C], h2 = new int[N][C];
		for(int c = 0; c < C; c++) {
			int cnt = 0;
			for(int r = 0; r < N; r++) {
				if(b[r][c] == '-') {
					v1[r][c] = cnt;
					cnt++;
				} else
					cnt = 0;
			}
		}
		for(int c = 0; c < C; c++) {
			int cnt = 0;
			for(int r = N - 1; r >= 0; r--) {
				if(b[r][c] == '-') {
					v2[r][c] = cnt;
					cnt++;
				} else
					cnt = 0;
			}
		}
		for(int r = 0; r < N; r++) {
			int cnt = 0;
			for(int c = 0; c < C; c++) {
				if(b[r][c] == '-') {
					h1[r][c] = cnt;
					cnt++;
				} else
					cnt = 0;
			}
		}
		for(int r = 0; r < N; r++) {
			int cnt = 0;
			for(int c = C - 1; c >= 0; c--) {
				if(b[r][c] == '-') {
					h2[r][c] = cnt;
					cnt++;
				} else
					cnt = 0;
			}
		}
		int mp = 0, mr = 0, mc = 0;
		for(int r = 0; r < N; r++)
			for(int c = 0; c < C; c++) {
				if(b[r][c] == '-') {
					int p = 0;
					for(int s = 1; s <= 5; s++) {
						p += Math.max(0, Math.min(v1[r][c], s - 1) + Math.min(v2[r][c], s - 1) - s + 2);
						p += Math.max(0, Math.min(h1[r][c], s - 1) + Math.min(h2[r][c], s - 1) - s + 2);
					}
					if(p > mp) {
						mp = p;
						mr = r;
						mc = c;
					}
				}
			}
		System.out.println(mr + " " + mc);
	}
}
